import http from '../../utils/request/request'
//申请接口 和申请管理


//创建申请
export function createApplication(data) {
    return http({
        url: `/breed/supply/apply/applicant`,
        method: 'post',
        data
    })
}

//修改申请
export function editApplication(data) {
    return http({
        url: `/breed/supply/apply/applicant/update`,
        method: 'put',
        data
    })
}

//删除申请
export function deleteApplication(id) {
    return http({
        url: `/breed/supply/apply/applicant/${id}`,
        method: 'delete',
    })
}
//批量删除
export function deleteApplicationBatch(ids) {
    return http({
        url: `/breed/supply/apply/applicant/batch`,
        method: 'delete',
        data:ids
    })
}
// 创建后发出申请
export function sendApplication(id) {
    return http({
        url: `/breed/supply/apply/applicant/send/${id}`,
        method: 'put',
    })
}
//分页查询
export function getApplicationByPage(type, size=5, page=1) {
    return http({
        url: `/breed/supply/apply/applicant/${type}/${size}/${page}`,
        method: 'get',
    })
}
//详情查询
export function getApplicationDetail(id) {
    return http({
        url: `/breed/supply/apply/applicant/one/${id}`,
        method: 'get',
    })
}

//管理接口
//分页查询
export function getApplicationManageByPage(type, size=5, page=1) {
    return http({
        url: `/breed/supply/apply/manager/${type}/${size}/${page}`,
        method: 'get',
    })
}
//详情查询
export function getApplicationManageDetail(id) {
    return http({
        url: `/breed/supply/apply/manager/one/${id}`,
        method: 'get',
    })
}

//单个删除
export function deleteApplicationManage(id) {
    return http({
        url: `/breed/supply/apply/manager/${id}`,
        method: 'delete',
    })
}
// 批量删除
export function deleteApplicationManageBatch(ids) {
    return http({
        url: `/breed/supply/apply/manager/batch`,
        method: 'delete',
        data:ids
    })
}
// 批阅
export function reviewManagement(id, status) {
    return http({
        url: `/breed/supply/apply/manager/resolve/${id}/${status}`,
        method: 'put',
    })
}




